﻿

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Abp;
using Abp.Domain.Services;
using LZ.DCode.DataDictionarys;
using LZ.DCode.DataDictionarys.Dtos;
using LZ.DCode.Dtos;

namespace LZ.DCode.DataDictionarys.DomainService
{
    public interface IDataDictionaryManager : IDomainService
    {

        /// <summary>
        /// 初始化方法
        ///</summary>
        void InitDataDictionary();



        /// <summary>
        /// 通过组名 获取组code desc列表
        /// </summary>
        Task<List<DataGroupList>> GetDataGroupListAsync(string groupCode);

        /// <summary>
        /// 通过组名 获取code desc 和 父Id列表
        /// </summary>
        Task<List<DataGroupTreeList>> GetDataGroupTreeListAsync(string groupCode);

        /// <summary>
        /// 通过组名 和 code值获取 配置的value
        /// </summary>
        Task<string> GetDataValueAsync(string groupCode, string code, string defaultValue);

        /// <summary>
        /// 通过组名获取ng Zorro树
        /// </summary>
        Task<List<NzTreeNode>> GetDataGroupNzTreeAsync(string groupCode, string selected_Code = null);
        /// <summary>
        /// 通过组名 获取组code  获取子集
        /// </summary>
        Task<List<string>> GetDataGroupArrayAsync(string groupCode, string code);
        /// <summary>
        /// 通过组名 获取组code  获取子集缓存
        /// </summary>
        List<string> GetDataGroupArrayCache(string groupCode, string code);
        /// <summary>
        /// 通过组名 获取组code desc缓存列表
        /// </summary>
        List<DataGroupList> GetDataGroupListCache(string groupCode);

        /// <summary>
        /// 通过组名 获取code desc 和 父Id缓存列表
        /// </summary>
        List<DataGroupTreeList> GetDataGroupTreeListCache(string groupCode);

        /// <summary>
        /// 通过组名 和 code值获取 配置的value 缓存
        /// </summary>
        string GetDataValueCache(string groupCode, string code, string defaultValue = null);

        /// <summary>
        /// 通过组名获取ng Zorro缓存树 
        /// </summary>
        List<NzTreeNode> GetDataGroupNzTreeCache(string groupCode, string selectedCode = null);

        /// <summary>
        /// 验证数据code
        /// </summary>
        Task<bool> CheckDataAsync(string groupCode, string code);

        /// <summary>
        /// 验证数据code
        /// </summary>
        bool CheckDataCache(string groupCode, string code);

        /// <summary>
        /// 树升级
        /// </summary>
        Task TreeUpgradeAsync(int id);

        /// <summary>
        /// 树降级
        /// </summary>
        Task TreeDowngradeAsync(int id);

        /// <summary>
        /// 树转移
        /// </summary>
        Task TreeTransferAsync(int id, int parentId);

    }
}

